package com.group1.common.pojo;

import lombok.Data;

@Data
public class ResponseResult<T> {
    private int code;
    private String message;
    private T data;

    public ResponseResult() {
    }

    public ResponseResult(final int code, final String message, final T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseResult(final int code, final String message) {
        this(code, message, null);
    }
    public static final ResponseResult<Void> SUCCESS = new ResponseResult<>(200, "ok");
    public static final ResponseResult<Void> FAILED = new ResponseResult<>(500, "failed");
    public static final ResponseResult<Void> INVALID_TOKEN = new ResponseResult<>(501, "Invalid Token");

    public ResponseResult(T data) {
        this(200, "ok", data);
    }
}
